home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / src-16f.lha / compiler / mips / parms.lisp < prev    next >
Encoding:
Text File  |  1992-02-15  |  5.9 KB  |  201 lines

  1. ;;; -*- Package: MIPS; Log: C.Log -*-
  2. ;;;
  3. ;;; **********************************************************************
  4. ;;; This code was written as part of the CMU Common Lisp project at
  5. ;;; Carnegie Mellon University, and has been placed in the public domain.
  6. ;;; If you want to use this code or any part of CMU Common Lisp, please contact
  7. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
  8. ;;;
  9. (ext:file-comment
  10.   "$Header: parms.lisp,v 1.99 92/02/14 23:50:29 wlott Exp $")
  11. ;;;
  12. ;;; **********************************************************************
  13. ;;;
  14. ;;; $Header: parms.lisp,v 1.99 92/02/14 23:50:29 wlott Exp $
  15. ;;;
  16. ;;;    This file contains some parameterizations of various VM
  17. ;;; attributes for the MIPS.  This file is separate from other stuff so 
  18. ;;; that it can be compiled and loaded earlier. 
  19. ;;;
  20. ;;; Written by Rob MacLachlan
  21. ;;;
  22. ;;; Converted to MIPS by William Lott.
  23. ;;;
  24.  
  25. (in-package "MIPS")
  26. (use-package "C")
  27.  
  28. (export '(word-bits byte-bits word-shift word-bytes))
  29.  
  30. (export '(float-underflow-trap-bit float-overflow-trap-bit
  31.       float-imprecise-trap-bit float-invalid-trap-bit
  32.       float-divide-by-zero-trap-bit single-float-trapping-nan-bit
  33.       double-float-trapping-nan-bit))
  34.  
  35.  
  36. ;;;; Compiler constants.
  37.  
  38. (eval-when (compile eval load)
  39.  
  40. (setf (backend-name *target-backend*) "PMAX")
  41. (setf (backend-version *target-backend*) "DECstation 3100/Mach 1.0")
  42. (setf (backend-fasl-file-type *target-backend*) "pmaxf")
  43. (setf (backend-fasl-file-implementation *target-backend*)
  44.       pmax-fasl-file-implementation)
  45. (setf (backend-fasl-file-version *target-backend*) 3)
  46. (setf (backend-register-save-penalty *target-backend*) 3)
  47. (setf (backend-byte-order *target-backend*) :little-endian)
  48.  
  49. ); eval-when
  50.  
  51.  
  52.  
  53. ;;;; Machine Architecture parameters:
  54.  
  55. (eval-when (compile load eval)
  56.  
  57. (defconstant word-bits 32
  58.   "Number of bits per word where a word holds one lisp descriptor.")
  59.  
  60. (defconstant byte-bits 8
  61.   "Number of bits per byte where a byte is the smallest addressable object.")
  62.  
  63. (defconstant word-shift (1- (integer-length (/ word-bits byte-bits)))
  64.   "Number of bits to shift between word addresses and byte addresses.")
  65.  
  66. (defconstant word-bytes (/ word-bits byte-bits)
  67.   "Number of bytes in a word.")
  68.  
  69.  
  70. (defconstant float-sign-shift 31)
  71.  
  72. (defconstant single-float-bias 126)
  73. (defconstant single-float-exponent-byte (byte 8 23))
  74. (defconstant single-float-significand-byte (byte 23 0))
  75. (defconstant single-float-normal-exponent-min 1)
  76. (defconstant single-float-normal-exponent-max 254)
  77. (defconstant single-float-hidden-bit (ash 1 23))
  78. (defconstant single-float-trapping-nan-bit (ash 1 22))
  79.  
  80. (defconstant double-float-bias 1022)
  81. (defconstant double-float-exponent-byte (byte 11 20))
  82. (defconstant double-float-significand-byte (byte 20 0))
  83. (defconstant double-float-normal-exponent-min 1)
  84. (defconstant double-float-normal-exponent-max #x7FE)
  85. (defconstant double-float-hidden-bit (ash 1 20))
  86. (defconstant double-float-trapping-nan-bit (ash 1 19))
  87.  
  88. (defconstant single-float-digits
  89.   (+ (byte-size single-float-significand-byte) 1))
  90.  
  91. (defconstant double-float-digits
  92.   (+ (byte-size double-float-significand-byte) word-bits 1))
  93.  
  94. (defconstant float-inexact-trap-bit (ash 1 0))
  95. (defconstant float-underflow-trap-bit (ash 1 1))
  96. (defconstant float-overflow-trap-bit (ash 1 2))
  97. (defconstant float-divide-by-zero-trap-bit (ash 1 3))
  98. (defconstant float-invalid-trap-bit (ash 1 4))
  99.  
  100. (defconstant float-round-to-nearest 0)
  101. (defconstant float-round-to-zero 1)
  102. (defconstant float-round-to-positive 2)
  103. (defconstant float-round-to-negative 3)
  104.  
  105. (defconstant float-rounding-mode (byte 2 0))
  106. (defconstant float-sticky-bits (byte 5 2))
  107. (defconstant float-traps-byte (byte 5 7))
  108. (defconstant float-exceptions-byte (byte 5 12))
  109. (defconstant float-condition-bit (ash 1 23))
  110. (defconstant float-fast-bit 0)              ; No fast mode on PMAX.
  111.  
  112. ); eval-when
  113.  
  114.  
  115. ;;;; Description of the target address space.
  116.  
  117. ;;; Where to put the different spaces.
  118. ;;; 
  119. (defparameter target-read-only-space-start #x01000000)
  120. (defparameter target-static-space-start    #x05000000)
  121. (defparameter target-dynamic-space-start   #x07000000)
  122.  
  123.  
  124.  
  125.  
  126. ;;;; Other non-type constants.
  127.  
  128. (export '(atomic-flag interrupted-flag halt-trap pending-interrupt-trap
  129.       error-trap cerror-trap breakpoint-trap function-end-breakpoint-trap
  130.       trace-table-normal trace-table-call-site
  131.       trace-table-function-prologue trace-table-function-epilogue))
  132.  
  133. (defenum (:suffix -flag)
  134.   atomic
  135.   interrupted)
  136.  
  137. (defenum (:suffix -trap :start 8)
  138.   halt
  139.   pending-interrupt
  140.   error
  141.   cerror
  142.   breakpoint
  143.   function-end-breakpoint)
  144.  
  145. (defenum (:prefix trace-table-)
  146.   normal
  147.   call-site
  148.   function-prologue
  149.   function-epilogue)
  150.  
  151.  
  152.  
  153. ;;;; Static symbols.
  154.  
  155. (export '(static-symbols exported-static-symbols))
  156.  
  157. ;;; These symbols are loaded into static space directly after NIL so
  158. ;;; that the system can compute their address by adding a constant
  159. ;;; amount to NIL.
  160. ;;;
  161. ;;; The exported static symbols are a subset of the static symbols that get
  162. ;;; exported to the C header file.
  163. ;;;
  164. (defparameter static-symbols
  165.   '(t
  166.  
  167.     ;; Random stuff needed for initialization.
  168.     lisp::lisp-environment-list
  169.     lisp::lisp-command-line-list
  170.  
  171.     ;; Functions that the C code needs to call
  172.     lisp::%initial-function
  173.     lisp::maybe-gc
  174.     kernel::internal-error
  175.     di::handle-breakpoint
  176.  
  177.     ;; Free Pointers
  178.     lisp::*read-only-space-free-pointer*
  179.     lisp::*static-space-free-pointer*
  180.     lisp::*initial-dynamic-space-free-pointer*
  181.  
  182.     ;; Things needed for non-local-exit.
  183.     lisp::*current-catch-block*
  184.     lisp::*current-unwind-protect-block*
  185.     *eval-stack-top*
  186.  
  187.     ;; Interrupt Handling
  188.     lisp::*free-interrupt-context-index*
  189.     unix::*interrupts-enabled*
  190.     unix::*interrupt-pending*
  191.  
  192.     ;; Static functions.
  193.     two-arg-+ two-arg-- two-arg-* two-arg-/ two-arg-< two-arg-> two-arg-=
  194.     two-arg-<= two-arg->= two-arg-/= eql %negate
  195.     two-arg-and two-arg-ior two-arg-xor
  196.     length two-arg-gcd two-arg-lcm
  197.     ))
  198.  
  199. (defparameter exported-static-symbols
  200.   (subseq static-symbols 0 (position 'two-arg-+ static-symbols)))
  201.